home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1996-05-01 | 5.8 KB | 203 lines | [ TEXT/MPS ]
; ; File: AppleScript.a ; ; Contains: AppleScript Specific Interfaces. ; ; Version: Technology: AppleScript 1.1 ; Release: Universal Interfaces 3.0d3 on Copland DR1 ; ; Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved. ; ; Bugs?: If you find a problem with this file, send the file and version ; information (from above) and the problem description to: ; ; Internet: apple.bugs@applelink.apple.com ; AppleLink: APPLE.BUGS ; ; IF &TYPE('__APPLESCRIPT__') = 'UNDEFINED' THEN __APPLESCRIPT__ SET 1 IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN include 'Errors.a' ENDIF IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN include 'AppleEvents.a' ENDIF IF &TYPE('__OSA__') = 'UNDEFINED' THEN include 'OSA.a' ENDIF IF &TYPE('__TEXTEDIT__') = 'UNDEFINED' THEN include 'TextEdit.a' ENDIF IF FOR_SYSTEM7_ONLY THEN ; ;************************************************************************* ; Types and Constants ;************************************************************************* ; ; ; The specific type for the AppleScript instance of the ; Open Scripting Architecture type. ; typeAppleScript EQU 'ascr' kAppleScriptSubtype EQU 'ascr' typeASStorage EQU 'ascr' ; ;************************************************************************* ; Component Selectors ;************************************************************************* ; kASSelectInit EQU $1001 kASSelectSetSourceStyles EQU $1002 kASSelectGetSourceStyles EQU $1003 kASSelectGetSourceStyleNames EQU $1004 ; ;************************************************************************* ; OSAGetScriptInfo Selectors ;************************************************************************* ; kASHasOpenHandler EQU 'hsod' ; ; This selector is used to query a context as to whether it contains ; a handler for the kAEOpenDocuments event. This allows "applets" to be ; distinguished from "droplets." OSAGetScriptInfo returns false if ; there is no kAEOpenDocuments handler, and returns the error value ; errOSAInvalidAccess if the input is not a context. ; ; ;************************************************************************* ; Initialization ;************************************************************************* ; ; ; pascal OSAError ASInit(ComponentInstance scriptingComponent, long modeFlags, long minStackSize, long preferredStackSize, long maxStackSize, long minHeapSize, long preferredHeapSize, long maxHeapSize) ; IF ¬ GENERATINGCFM THEN Macro _ASInit move.l #$001C1001,-(sp) moveq #0,D0 dc.w $A82A EndM ELSE IMPORT_CFM_FUNCTION ASInit ENDIF ; ; ComponentCallNow(kASSelectInit, 28); ; This call can be used to explicitly initialize AppleScript. If it is ; not called, the a scripting size resource is looked for and used. If ; there is no scripting size resource, then the constants listed below ; are used. If at any stage (the init call, the size resource, the ; defaults) any of these parameters are zero, then parameters from the ; next stage are used. ModeFlags are not currently used. ; Errors: ; errOSASystemError initialization failed ; ; ; These values will be used if ASInit is not called explicitly, or if any ; of ASInit's parameters are zero: ; kASDefaultMinStackSize EQU 4096 kASDefaultPreferredStackSize EQU 16384 kASDefaultMaxStackSize EQU 16384 kASDefaultMinHeapSize EQU 4096 kASDefaultPreferredHeapSize EQU 16384 kASDefaultMaxHeapSize EQU 33554432 ; ;************************************************************************* ; Source Styles ;************************************************************************* ; ; ; pascal OSAError ASSetSourceStyles(ComponentInstance scriptingComponent, STHandle sourceStyles) ; IF ¬ GENERATINGCFM THEN Macro _ASSetSourceStyles move.l #$00041002,-(sp) moveq #0,D0 dc.w $A82A EndM ELSE IMPORT_CFM_FUNCTION ASSetSourceStyles ENDIF ; ; ComponentCallNow(kASSelectSetSourceStyles, 4); ; Errors: ; errOSASystemError operation failed ; ; ; pascal OSAError ASGetSourceStyles(ComponentInstance scriptingComponent, STHandle *resultingSourceStyles) ; IF ¬ GENERATINGCFM THEN Macro _ASGetSourceStyles move.l #$00041003,-(sp) moveq #0,D0 dc.w $A82A EndM ELSE IMPORT_CFM_FUNCTION ASGetSourceStyles ENDIF ; ; ComponentCallNow(kASSelectGetSourceStyles, 4); ; Errors: ; errOSASystemError operation failed ; ; ; pascal OSAError ASGetSourceStyleNames(ComponentInstance scriptingComponent, long modeFlags, AEDescList *resultingSourceStyleNamesList) ; IF ¬ GENERATINGCFM THEN Macro _ASGetSourceStyleNames move.l #$00081004,-(sp) moveq #0,D0 dc.w $A82A EndM ELSE IMPORT_CFM_FUNCTION ASGetSourceStyleNames ENDIF ; ; ComponentCallNow(kASSelectGetSourceStyleNames, 8); ; This call returns an AEList of styled text descriptors the names of the ; source styles in the current dialect. The order of the names corresponds ; to the order of the source style constants, below. The style of each ; name is the same as the styles returned by ASGetSourceStyles. ; ; Errors: ; errOSASystemError operation failed ; ; ; Elements of STHandle correspond to following categories of tokens, and ; accessed through following index constants: ; kASSourceStyleUncompiledText EQU 0 kASSourceStyleNormalText EQU 1 kASSourceStyleLanguageKeyword EQU 2 kASSourceStyleApplicationKeyword EQU 3 kASSourceStyleComment EQU 4 kASSourceStyleLiteral EQU 5 kASSourceStyleUserSymbol EQU 6 kASSourceStyleObjectSpecifier EQU 7 kASNumberOfSourceStyles EQU 8 ; Gestalt selectors for AppleScript gestaltAppleScriptAttr EQU 'ascr' gestaltAppleScriptVersion EQU 'ascv' gestaltAppleScriptPresent EQU 0 gestaltAppleScriptPowerPCSupport EQU 1 ENDIF ENDIF ; __APPLESCRIPT__